<?php
/**
 * My account page controller
 *
 * @author Dima
 *
 */

class BillingController extends modules_default_controllers_ControllerUserarea
{

	public $ajaxable = array(
	);

//----------------------------------------------------------------------------------------------------

	public function init()
	{
		if (! $this->getRequest()->isXmlHttpRequest())
		{
			parent::init();
		}
	}

//----------------------------------------------------------------------------------------------------

	public function indexAction()
	{
//		$this->view->headScript()->appendFile('/js/billing.js');

		$idUser 		= Lemar_User::getLoggedUserId();
		$oRequest 		= $this->getRequest();
		
        if ($oRequest->isPost())
        {
		    $idUser	      = $oRequest->getParam('id');
		    $newPassword  = $oRequest->getParam('password');
		    models_userMapper::updateUser($idUser, 'password', $newPassword);
            $this->_redirect('/');    
        }
		$this->view->user 	= models_UserMapper::findById($idUser);

	}

//----------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------
}